package com.cleargroup.magic.cleara.c.command;

import android.os.Parcel;
import android.os.Parcelable;

public class CacheItem implements Parcelable{
	public long cacheSize;
	public String appName;
	public String pkgName;
	public String iconUri;
    public boolean checked = true;

	public CacheItem(String pkgName, String appName,
                     long cacheSize) {
		this.pkgName = pkgName;
		this.appName = appName;
		this.cacheSize = cacheSize;
		this.iconUri = "package://" + pkgName;
	}

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(cacheSize);
        dest.writeString(appName);
        dest.writeString(pkgName);
        dest.writeString(iconUri);
    }

    public static final Creator<CacheItem> CREATOR
            = new Creator<CacheItem>() {
        public CacheItem createFromParcel(Parcel in) {
            return new CacheItem(in);
        }

        public CacheItem[] newArray(int size) {
            return new CacheItem[size];
        }
    };

    private CacheItem(Parcel in) {
        cacheSize = in.readLong();
        appName = in.readString();
        pkgName = in.readString();
        iconUri = in.readString();
    }

}